package com.ruoyi.eqmonitor.smdtv.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.eqmonitor.smdtv.domain.Smdtv17;
import com.ruoyi.eqmonitor.smdtv.mapper.SmregisterMapper;
import com.ruoyi.eqmonitor.smdtv.service.ISmdtv17Service;
import com.ruoyi.eqmonitor.smdtv.mapper.Smdtv17Mapper;
import com.ruoyi.eqmonitor.smdtv.vo.SumVo;
import com.ruoyi.eqmonitor.utils.Constant;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description 针对表【smdtv_17】的数据库操作Service实现
 * @createDate 2022-12-05 14:30:53
 */
@Service
public class Smdtv17ServiceImpl extends ServiceImpl<Smdtv17Mapper, Smdtv17>
        implements ISmdtv17Service {

    @Resource
    private Smdtv17Mapper smdtv17Mapper;

    @Resource
    private SmregisterMapper smregisterMapper;

    @Override
    public SumVo getSum(String name) {
        SumVo sumVo = new SumVo();
        Long value = smregisterMapper.getSum(name,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_17.getName()));
        sumVo.setName("其他");
        sumVo.setValue(value);
        return sumVo;
    }

    @Override
    public List<Smdtv17> getByName(String name) {
        return smdtv17Mapper.getByName(name,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_17.getName()));
    }
}




